<?php
$this->breadcrumbs=array(
	tt('Files'),
);

$this->menu=array(
	array('label'=>tt('Create User'), 'url'=>array('create')),
	array('label'=>tt('Manage User'), 'url'=>array('admin')),
);

$this->h1 = tt('Files');
?>


<?php
$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'cssFile'=>Yii::app()->theme->baseUrl.'/css/tables.css',
	'itemsCssClass'=>'item-class',
	'pagerCssClass'=>'pager-class',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'name' => 'id',
			'sortable' => true,
			'htmlOptions' => array('class'=>'grid-id-column'),
		),
		
		array(
			'header' => tt('Recipient'),
			'type' => 'raw',
			'value' => '$data["recipientName"]',
		),
				
		array(
			'header' => tt('Sender'),
			'type' => 'raw',
			'value' => '$data["senderName"]',
		),
				
		array(
			'header' => tt('File'),
			'type' => 'raw',
			'value' => 'CHtml::link($data["filename"], Yii::app()->createAbsoluteUrl("/uploads")."/".$data["filename"], array("target"=>"_blank"))',
		),
		
		array(
			'name' => 'creationDate',
			'htmlOptions' => array('class'=>'grid-date-column'),
			'sortable' => true,
		),
		
		array(
			'class'=>'CButtonColumn',
			'template'=>'{delete}',
			'deleteConfirmation' => tt('Are you sure you want to delete this user?'),
			'htmlOptions' => array('class'=>'button-column'),
			'buttons' => array(
				'delete' => array(
					'imageUrl' => $url = Yii::app()->theme->baseUrl.'/images/icon_delete.png',
				),
			),
		),
	),
));
?>
